package game.module.dabt.logic;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import game.common.ItemConstants;
import game.entity.PlayingRole;
import game.module.item.logic.ItemManager;
import game.session.SessionManager;



public class ChargeJindou {
	
	private static Logger logger = LoggerFactory.getLogger(ChargeJindou.class);

	static class SingletonHolder {
		static ChargeJindou instance = new ChargeJindou();
	}
	
	public static ChargeJindou getInstance() {
		return SingletonHolder.instance;
	}
	
	public void tollJindou(int halfjindou,List<Integer> players) {
		logger.info("game start jindou room charge players ={}",players);
		for (Integer aPlayer : players) {
			PlayingRole pr = SessionManager.getInstance().getPlayer(aPlayer);
			ItemManager.getInstance().reduceItemsAndPush(pr.getId(), ItemConstants.YUANBAO_ITEM_ID,
					halfjindou);
		}
	}	
}
